#include "StdAfx.h"
#include "MonMsg.h"


CMonHeader::CMonHeader()
{
	m_ucPrefix[0] = m_ucPrefix[1] = 0x55;
	m_usHeaderLen = 0;
	m_ucServerType = 0;
	m_unPacketCount = 0;
}

CMonPacket::CMonPacket()
{
	m_usIndexID = 0;
	m_unDelay = 0;

	memset(m_serverIPAddr, 0, sizeof(m_serverIPAddr));
	memset(m_serverName, 0, sizeof(m_serverName));
	memset(m_szProcessName, 0, sizeof(m_szProcessName));
	memset(m_szRunState, 0, sizeof(m_szRunState));
	memset(m_strCode, 0, sizeof(m_strCode));
	memset(m_strMsg, 0, sizeof(m_strMsg));

	m_bKillProcess = false;
	m_bAlarm = false;
}

CMonPacket& CMonPacket::operator =(const CMonPacket& rhs)
{
	strcpy(m_serverIPAddr, rhs.m_serverIPAddr);
	strcpy(m_strCode, rhs.m_strCode);
	strcpy(m_strMsg, rhs.m_strMsg);
	strcpy(m_szProcessName, rhs.m_szProcessName);
	strcpy(m_serverName, rhs.m_serverName);
	strcpy(m_szRunState, rhs.m_szRunState);
	m_usIndexID = rhs.m_usIndexID;
	m_unDelay = rhs.m_unDelay;
	m_usPort = rhs.m_usPort;
	return *this;
}

CMonTailer::CMonTailer()
{
	m_ucCheckSum = 0;

	m_ucSuffix[0] = m_ucSuffix[1] = 0x16;
}